// 业务数据实体类型


import { AlarmHandleStatus, MaintenancePlanHandleStatus } from '#/enmu.ts';

export interface UserInfo {
  id: number;
  userName: string;
  realName: string;
  phone?: string;
  resetPassword: boolean;
  userBlock: boolean;
  companyId: number;
  companyName: string;
  roleList: RoleInfo[];
  token?: string;
  headImage?: string
}

export interface Company {
  id: number;
  companyName: string;
}

export interface RoleInfo {
  id: number;
  roleName: string;
  userId: number;
  roleDesc: string;
  menuVoList: MenuVoInfo[];
}

export interface MenuVoInfo {
  id: number;
  parentId: number;
  menuPath: string;
  childrenMenu?: MenuVoInfo[];
  menuName: string
}


export interface Account {
  id?: number;
  userName?: string;
  phone?: string;
  realName?: string;
  roleIds?: number;
  userBlock?: boolean;
  companyId?: number;
  oldPassword?: string;
  password?: string
  headImage?: string
}

export interface AccountWithId extends Account {
  id: number;
}

export interface AssignRoleParams extends Record<string, string> {
  userId: string,
  roleIds: string
}

/**
 * Event Center
 */
export interface DeviceInfo {
  id: number;
  serialNumber: string;
  carNo: string;
  deviceName: string;
  whetherOnline: boolean;
}

export interface MediaSource {
  id: number,
  fileName: string
  fileUrl: string
}

export interface EventInfo {
  id: number;
  alarmId: number;
  alarmType: number;
  alarmDesc: string;
  alarmTime: string;
  alarmPosition: string;
  carNo: string;
  deviceName: string;
  handleTime: string;
  handleName: string;
  handleStatus: keyof typeof AlarmHandleStatus;
  handleStatusOrder: number;
  serialNumber: string;
  latitude: string;
  longitude: string;
  whetherHandle: boolean;
  imageList: MediaSource[];
  videoList: MediaSource[];
}

/**
 * Maintenance Plan
 */
export interface MaintenancePlanInfo {
  id: number;
  alarmId: number;
  carNo: string;
  alarmDesc: string;
  alarmTime: string;
  reportUserId: number;
  reportUserName: string;
  departmentId: number;
  reportName: string;
  reportLng: string;
  reportLat: string;
  reportPosition: string;
  reportTime: string;
  dealWithStatus: keyof typeof MaintenancePlanHandleStatus;
  reportDesc: string;
  delayFlag: boolean;
  delayTime: string;
  delayReason: string;
  delayRemarks: string;
  workOrderId: number;
  fileList: MediaSource[];
}

export interface ReporterInfo {
  id: number,
  name: string
}

export interface OrderInfo {
  id: number;
  name: string;
  beginTime: string;
  endTime: string;
  userId: number;
  userName: string;
  headId: number;
  headName: string;
  remarks: string;
  handleStatus: boolean;
  handleTime: string;
  fileList: MediaSource[];
  alarmId: number;
  alarmDesc: string;
  carNo: string;
  alarmTime: string;
  reportId: number;
  reportName: string;
  reportLng: string;
  reportLat: string;
  reportPosition: string;
}

export interface OrderDetail extends OrderInfo {
  notes?: string;
  latitude: string;
  longitude: string;
  alarmPosition: string;
  alarmFileList: MediaSource[];
  reportDesc: string;
}

export interface OSSDataType {
  dir: string;
  expire: string;
  host: string;
  accessId: string;
  policy: string;
  signature: string;
}

export interface AlarmCount {
  alarmTotal: number;
  todayAlarmCount: number;
  monthAlarmCount: number;
}

export interface AlarmTime {
  alarmTotal: number;
  pushAlarmCount: number;
  interveneAlarmCount: number;
}

export interface AlarmDeal {
  alarmTotal: number;
  unDealWithCount: number;
  dealWithCount: number;
  ignoredCount: number;
}

export interface AlarmTrend {
  date: string;
  alarmTimes: number;
}

export interface DeviceCount {
  deviceTotal: number;
  onlineDeviceCount: number;
  offlineDeviceCount: number;
}

export interface Equipment {
  id: number;
  carNo: string;
  equipmentId: string;
  channel: string;
}

export interface CarTrackInfo {
  deviceTime: string;
  longitude: number;
  latitude: number;
  address: string;
  status?: number;
}

export interface CarInfo {
  carNo: string;
  carStatus: number;
  carTrackPartPo?: CarTrackInfo;
}

export interface CompanyCar {
  id: number;
  companyName: string;
  carList: CarInfo[];
}

export interface CarRealTimeLocation {
  address: string;
  alarmDesc?: string;
  carNo: string;
  deviceTime: string;
  latitude: number;
  longitude: number;
}


export interface AlarmInfo {
  id: number;
  alarmDesc: string;
  alarmTime: string;
  latitude: string;
  longitude: string;
  alarmPosition: string;
  imageList: MediaSource[];
  videoList: MediaSource[];
}

export interface LocationInfo {
  id: number;
  locationId: number;
  version: number;
  serialNumber: string;
  plateNumber: string;
  deviceTime: string;
  recordTime: string;
  mode: number;
  status: number;
  longitude: number;
  latitude: number;
  address: string;
  alarmDesc: string;
  alarmId: number;
  imageList: MediaSource[];
  videoList: MediaSource[];
}

export interface ParkingLocationInfo {
  carNo: string;
  parkStartTime: string;
  parkEndTime: string;
  duration: number;
  parkDuration: number;
  lng: string;
  lat: string;
  address: string;
}
